<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:fragment="common_head(title,style)">
    <meta charset="UTF-8">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <meta name="viewport" content="width=device-width, initial-scale=1"/>
    <title th:replace="${title}"></title>
    <link rel="icon" th:href="@{/static/image/zookeeper_small.gif}"/>
    <link rel="stylesheet" th:href="@{/static/css/admin.css}">
    <link rel="stylesheet" th:href="@{/webjars/bootstrap/css/bootstrap.min.css}">
    <link rel="stylesheet" th:href="@{/webjars/font-awesome/css/font-awesome.min.css}">
    <link rel="stylesheet" th:href="@{/webjars/toastr/toastr.css}">
    <link rel="stylesheet" th:href="@{/webjars/zTree/css/zTreeStyle/zTreeStyle.css}">
    <link rel="stylesheet" th:href="@{/webjars/select2/css/select2.min.css}">
    <link rel="stylesheet" th:href="@{/webjars/highlightjs/styles/vs.css}">
    <style th:replace="${style}"></style>
</head>
<body>
<nav th:fragment="navbar" class="navbar navbar-inverse navbar-fixed-top">
    <div class="container-fluid">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle show pull-left" data-target="sidebar">
                <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span>
            </button>
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar"
                    aria-expanded="false" aria-controls="navbar">
                <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" th:href="@{/index}">zk-admin</a>
        </div>
        <div id="navbar" class="collapse navbar-collapse">
            <ul class="nav navbar-nav navbar-right">
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button"
                       aria-expanded="false"><i class="fa fa-user fa-fw"></i><span th:text="${session.session_user.username}"></span><span class="caret"></span></a>
                    <ul class="dropdown-menu" role="menu">
                        <li><a id="a_sign_out" href="#">退出</a></li>
                    </ul>
                </li>
            </ul>
            <form id="form_sign_out" th:action="@{/sign_out}" method="post"></form>
        </div>
    </div>
</nav>
<ul th:fragment="sidebar(li)">
    <li><a th:href="@{/index}">首页</a></li>
    <li th:if="${session.session_user.id} == 1"><a th:href="@{/users}">用户管理</a></li>
    <li th:if="${session.session_user.id} == 1"><a th:href="@{/zkinfos}">zookeeper管理</a></li>
    <li th:each="zkinfo:${zkinfos}" th:if="${zkinfo.connState != 'LOST'}"><a th:href="@{/zkinfo/{alias}(alias=${zkinfo.alias})}" th:text="${zkinfo.alias}"></a></li>
</ul>
<div th:fragment="script">
    <script type="text/javascript" th:src="@{/webjars/jquery/jquery.min.js}"></script>
    <script type="text/javascript" th:src="@{/webjars/bootstrap/js/bootstrap.min.js}"></script>
    <script type="text/javascript" th:src="@{/webjars/pace/pace.min.js}"></script>
    <script type="text/javascript" th:src="@{/webjars/toastr/toastr.js}"></script>
    <script type="text/javascript" th:src="@{/webjars/zTree/js/jquery.ztree.core.min.js}"></script>
    <script type="text/javascript" th:src="@{/webjars/zTree/js/jquery.ztree.excheck.min.js}"></script>
    <script type="text/javascript" th:src="@{/webjars/zTree/js/jquery.ztree.exedit.min.js}"></script>
    <script type="text/javascript" th:src="@{/webjars/select2/js/select2.min.js}"></script>
    <script type="text/javascript" th:src="@{/webjars/ckeditor/full/ckeditor.js}"></script>
    <script type="text/javascript" th:src="@{/webjars/highlightjs/highlight.min.js}"></script>
    <script type="text/javascript" th:src="@{/static/js/sweetalert.min.js}"></script>
    <script type="text/javascript" th:src="@{/static/js/admin.js}"></script>
    <script type="text/javascript" th:src="@{/static/js/scrolltopcontrol.js}"></script>
    <script type="text/javascript" th:src="@{/static/js/context.js}"></script>
</div>
</body>
</html>